package cn.felord.debezium.task;
import lombok.extern.slf4j.Slf4j;

/**
 * 通知远程
 * http
 * get方式
 * 传参id = 1222
 */
@Slf4j
public class ActionSendHttpUtils {
    public static synchronized void  act(String noticeUrl,String tableName,Integer id){
        if(tableName.equals("tb_upload_melter")) {
            //出铁温度异常
           // log.info("1、出铁温度异常推送");
            String url = noticeUrl + "/api/ctwdALarmTaskR3Controller/tui";
            String s = HttpUtils.sendGet(url, "id=" + id);
//            JSONObject parse = (JSONObject) JSONObject.parse(s);
           // log.info("2、熔炼炉同步melterrecord");
            String url1 = noticeUrl + "/api/melterRecordTaskController/do";
            String s1 = HttpUtils.sendGet(url1, "id=" + id);

        }else if(tableName.equals("tb_upload_pouringpack")){
            //浇注温度异常
           // log.info("1、触发浇注温度异常推送");
            String url = noticeUrl + "/api/pGTaskR1R3/check";
            String s = HttpUtils.sendGet(url,"id=" + id);
            //孕育剂加入异常
           // log.info("2、触发孕育剂加入异常推送");
            String url1 = noticeUrl + "/api/pushTaskYRJJRLYCR3Controller/push";
            String s1 = HttpUtils.sendGet(url1,"id=" + id);
           // log.info("3、浇注超时推送判断");
            String url2 = noticeUrl + "/api/pushTaskJZCS/push";
            String s2 = HttpUtils.sendGet(url2,"id=" + id);

        }else if(tableName.equals("tb_upload_feed_spheroidization")){
            //丝速度异常
           // log.info("触发丝速度异常推送");
            String url = noticeUrl +"/api/pushTaskWSR3Controller/check";
            String s = HttpUtils.sendGet(url,"id=" + id);
//            System.out.println("收到：" + s);
        }else if(tableName.equals("tb_upload_smelt_iron")){
            //出铁重量异常
           // log.info("触发出铁重量异常推送");
            String url = noticeUrl +"/api/pushTaskCTZLR3Controller/push";
            String s = HttpUtils.sendGet(url,"id=" + id);

        }else if(tableName.equals("tb_order_plan_cut")){
            //切线监听
           // log.info("触发切线监听");
            String url = noticeUrl +"/api/orderPlanCutTaskController/gxrk";
            String s = HttpUtils.sendGet(url,"id=" + id);
        }else if(tableName.equals("tb_detection_rl")){
            //切线监听
           // log.info("质检补加量计算");
            String url = noticeUrl +"/api/tbDetectionRlAddHjFeedingCount/receive";
            String s = HttpUtils.sendGet(url,"id=" + id);

        }




    }


}
